import request from '@/plugins/request';
var pre = '/officeArticles/officeApply';
if (process.env.NODE_ENV !== "development") {
  pre = "/api/sa/conv-app" + pre;
}

// 查询办公用品申请
export function getPageForApplys(data) {
  return request({
    url: `${pre}/page`,
    method: "post",
    data,
  });
}

// 办公用品申请添加
export function add(data) {
  return request({
    url: `${pre}/add`,
    method: 'post',
    data
  });
}

// 办公用品申请信息修改
export function edit(data) {
  return request({
    url: `${pre}/edit`,
    method: 'post',
    data
  });
}

// 删除办公用品申请
export function del(data) {
  return request({
    url: `${pre}/del`,
    method: 'post',
    data
  });
}

// 根据id获取办公用品申请信息
export function getById(AppId) {
  return request({
    url: `${pre}/get?AppId=${AppId}`,
    method: 'GET',
  });
}
//取消
export function cancel(AppId) {
  return request({
    url: `${pre}/cancel?AppId=${AppId}`,
    method: 'GET',
  });
}
// 办公用品申请提交
export function officeAppSubmit(data) {
  return request({
    url: `${pre}/submit`,
    method: 'post',
    data
  });
}

var cateUrl = "/officeArticles/categoryManagement"
if (process.env.NODE_ENV !== "development") {
  cateUrl = "/api/sa/conv-app" + cateUrl;
}
// 查询办公用品分类信息
export function getCategoryTree() {
  return request({
    url: `${cateUrl}/tree`,
    method: "GET",
  });
}

var preUrl = "/officeArticles/StockTotalManagement"
if (process.env.NODE_ENV !== "development") {
  preUrl = "/api/sa/conv-app" + preUrl;
}
// 查询办公用品信息
export function getPageForArticles(data) {
  return request({
    url: `${preUrl}/pageTotal`,
    method: "post",
    data,
  });
}


